home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
EditFields
/
EditFields.h
< prev
next >
Wrap
Text File
|
1992-09-10
|
3KB
|
82 lines
/****************************************************************************************
*
*
* Edit Field Library- .h Definition File
*
* 9/9/92 ©ImproVision UK. Written by Graham Cox.
*
****************************************************************************************/
#include "SANE.h"
typedef struct
{
int efID; /* ID number of the field */
Rect edViewRect; /* display rect in local coordinates*/
long upLimit,lowLimit; /* limit values for this field */
long edFlags; /* parameter flags */
struct EditField **nextField; /* handle to next field */
Str255 edFieldText; /* text in the field */
}
EditField, *EditFieldPtr, **EditFieldHdl;
typedef struct
{
WindowPtr efOwner; /* window that owns the fields */
int currentField; /* ID of current field being edited */
int numFields; /* number of fields in list */
EditFieldHdl efListHead; /* Handle to first field in list */
TEHandle efText; /* Text Edit Record used to edit */
long userRefCon; /* Application available field */
long reserved; /* for future use */
}
EFList, *EFListPtr, **EFListHdl;
#define fieldNoRestriction 0
#define fieldAlphabetic 1
#define fieldNumeric 2
#define fieldUnsigned 4
#define fieldInteger 8
#define fieldLongint 16
#define fieldFloatingPoint 32
#define fieldNoScroll 64
#define fieldUpperCase 128
#define fieldLowerCase 256
#define fieldIgnoreLimits 512
#define fieldConvertTicks 1024
#define fieldDataChanged 2048
/* bits above 2048 are reserved for future use */
#define NIL nil
/*--------------------------- FUNCTION PROTOTYPES ---------------------------------*/
EditFieldHdl NewEditField(Rect *bounds,int IDnum,Str255 *theText);
void LinkEditField(EFListHdl efList,EditFieldHdl eField);
void Draw1Field(EditFieldHdl theField);
void SetFieldText(EditFieldHdl theField,Str255 *theText);
void GetFieldText(EditFieldHdl theField,Str255 *theText);
void SetFPField(EditFieldHdl theField,extended fpValue,int nDecPlaces);
extended GetFPField(EditFieldHdl theField);
void SetEdFlags(EditFieldHdl theField,long theFlags);
long GetEdFlags(EditFieldHdl theField);
EFListHdl NewEditFieldList(WindowPtr ownerWindow);
void DisposeEditFieldList(EFListHdl theList);
EditFieldHdl GetIndexedField(EFListHdl efList,int theIndex);
void IncDecCurrentField(EFListHdl efList,Boolean incDecFlag);
void DrawEditFields(EFListHdl efList);
void SelectEditField(EFListHdl efList,int theIndex);
int FindEditField(EFListHdl efList,Point mClick);
void EFIdle(EFListHdl efList);
int CheckFieldLimits(EditFieldHdl theField,EFListHdl efList);
void KeyField(EFListHdl efList,char theKey);
void SetAndUpdateField(EFListHdl efList,int theFieldID,long fValue);